<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SSE</title>
</head>
<body>
    <div id="sse"></div>
    <script>
        let eventSource = new EventSource("/sse/stream");
        eventSource.onmessage = function(event) {
            document.getElementById("sse").innerHTML=event.data;
        }
        // eventSource.addEventListener("foo", (event)=>{
        //     document.getElementById("sse").innerHTML=event.data;
        // });
        // eventSource.addEventListener("end", (event)=>{
        //     eventSource.close();
        // });
    </script>
</body>
</html>